<%@ page import="java.util.Random" %>
<%@ page import="Entities.DoeBookEntity" %>
<%@ page import="org.hibernate.Session" %><%--
Created by IntelliJ IDEA.
User: Administrator
Date: 4018/4/8/008
Time: 19:56
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<!--重新选择标签页面-->
<html>
<head>
    <link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
    <script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="http://cdn.static.runoob.com/libs/jquery/1.10.2/jquery.min.js"></script>
    <title>Title</title>
</head>
<body background="image/night.jpg" style="background-size: cover;background-color: transparent">
<%!int x=40;Random ran =new Random();%>
<%
String[] tags=(String[]) session.getAttribute("tags");
int index = 0;
%>
<%!String[] books = new String[8];%>
<div class="container">
    <div class="row clearfix">
        <div class="col-md-12 column" style="padding-top: 20px">
            <form action="updateTagAction" id="tagSubmit" method="post">
                <h2 class="tag">
                    Now，选择你喜欢的类型(六个)：
                </h2>
            </form>
            <a href="firstSelectTag.jsp" class="pull-right" ><span style="color: #111111"><h3>换一批</h3></span></a>
        </div>
        <div style="padding-left: 100px;padding-top: 100px">
            <input type="button" name="test1" onclick="admin_login(this)" class="btn btn-default" onclick="admin_login(this)" class="btn btn-default" style="height: <%=60+ran.nextInt(100)%>px;width: <%=40+ran.nextInt(100)%>px" value="<%=tags[index++]%>">
            <input type="button"  class="btn btn-primary" onclick="admin_login(this)" class="btn btn-default" style="height: <%=60+ran.nextInt(100)%>px;width: <%=60+ran.nextInt(100)%>px" value="<%=tags[index++]%>">
            <input type="button"  class="btn btn-success" onclick="admin_login(this)" class="btn btn-default" style="height: <%=60+ran.nextInt(100)%>px;width: <%=60+ran.nextInt(100)%>px" value="<%=tags[index++]%>">
            <input type="button"  class="btn btn-warning" onclick="admin_login(this)" class="btn btn-default" style="height: <%=60+ran.nextInt(100)%>px;width: <%=60+ran.nextInt(100)%>px" value="<%=tags[index++]%>">
            <input type="button"  class="btn btn-primary" onclick="admin_login(this)" class="btn btn-default" style="height: <%=60+ran.nextInt(100)%>px;width: <%=60+ran.nextInt(100)%>px" value="<%=tags[index++]%>">
            <input type="button"  class="btn btn-success" onclick="admin_login(this)" class="btn btn-default" style="height: <%=60+ran.nextInt(100)%>px;width: <%=60+ran.nextInt(100)%>px" value="<%=tags[index++]%>">
        </div>
        <div style="padding-left: 200px">
            <input type="button" class="btn btn-warning" onclick="admin_login(this)" class="btn btn-default" style="height: <%=60+ran.nextInt(100)%>px;width: <%=40+ran.nextInt(100)%>px" value="<%=tags[index++]%>">
            <input type="button"  class="btn btn-default" onclick="admin_login(this)" class="btn btn-default" style="height: <%=60+ran.nextInt(100)%>px;width: <%=60+ran.nextInt(100)%>px" value="<%=tags[index++]%>">
            <input type="button"  class="btn btn-primary" onclick="admin_login(this)" class="btn btn-default" style="height: <%=60+ran.nextInt(100)%>px;width: <%=60+ran.nextInt(100)%>px" value="<%=tags[index++]%>">
            <input type="button"  class="btn btn-danger" onclick="admin_login(this)" class="btn btn-default" style="height: <%=60+ran.nextInt(100)%>px;width: <%=60+ran.nextInt(100)%>px" value="<%=tags[index++]%>">
            <input type="button"  class="btn btn-warning" onclick="admin_login(this)" class="btn btn-default" style="height: <%=60+ran.nextInt(100)%>px;width: <%=60+ran.nextInt(100)%>px" value="<%=tags[index++]%>">
            <input type="button"  class="btn btn-primary" onclick="admin_login(this)" class="btn btn-default" style="height: <%=60+ran.nextInt(100)%>px;width: <%=60+ran.nextInt(100)%>px" value="<%=tags[index++]%>">
        </div>
        <div style="padding-left: 100px">
            <input type="button"  class="btn btn-danger" onclick="admin_login(this)" class="btn btn-default" style="height: <%=60+ran.nextInt(100)%>px;width: <%=60+ran.nextInt(100)%>px" value="<%=tags[index++]%>">
            <input type="button"  class="btn btn-primary" onclick="admin_login(this)" class="btn btn-default" style="height: <%=60+ran.nextInt(100)%>px;width: <%=60+ran.nextInt(100)%>px" value="<%=tags[index++]%>">
            <input type="button" class="btn btn-" onclick="admin_login(this)" class="btn btn-default" style="height: <%=60+ran.nextInt(100)%>px;width: <%=40+ran.nextInt(100)%>px" value="<%=tags[index++]%>">
            <input type="button"  class="btn btn-default" onclick="admin_login(this)" class="btn btn-default" style="height: <%=60+ran.nextInt(100)%>px;width: <%=60+ran.nextInt(100)%>px" value="<%=tags[index++]%>">
            <input type="button"  class="btn btn-warning" onclick="admin_login(this)" class="btn btn-default" style="height: <%=60+ran.nextInt(100)%>px;width: <%=60+ran.nextInt(100)%>px" value="<%=tags[index++]%>">
            <input type="button"  class="btn btn-primary" onclick="admin_login(this)" class="btn btn-default" style="height: <%=60+ran.nextInt(100)%>px;width: <%=60+ran.nextInt(100)%>px" value="<%=tags[index++]%>">
        </div>
        <div style="padding-left: 900px;padding-top: 50px">
            <input type="submit" value="提交" id="submit" class="btn btn-default" style="height: 50px;width: 100px" disabled="true" onclick="mySubmit()">
        </div>
    </div>
</div>
</body>

<script>

    function admin_login(lable) {
        if($(".select").length==5){
            $("#submit").removeAttr("disabled");
        }
        if($(".select").length>5){
            alert("最多六个标签");
            return;
        }
        var text ="<input type=\"text\" style=\"width:100px\" class=\"select btn btn-default\" name=\"user_tag"+($(".select").length+1)+"\" value=\""+lable.value+"\">";
        $(".tag").append(text);
        $(lable).hide();
    }


    function mySubmit(){
        $("#tagSubmit").submit();    }


</script>
</html>
